﻿using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
using System;

public class GameMgr : Singleton<GameMgr>
{
    //根节点
    GameObject _engineRoot;

    public void Init()
    {
        if (_engineRoot == null)
        {
            _engineRoot = new GameObject("GameEngine");
            GameObject.DontDestroyOnLoad(_engineRoot);
            _engineRoot.AddComponent<GameEngine>();
        }
        UIManager.instance.Init();
        QuickCoroutine.instance.Init();
        //QuickCoroutine.Instance.WaitTime(0,false,onWaitCoroutine);

        //启动游戏引擎

        //跳转第一个逻辑界面
        //Application.LoadLevel("Login");
        SceneManager.LoadScene("Login");
        UIManager.instance.Replace("UI/Login/Login", UILayer.Normal);

    }

    private void onWaitCoroutine()
    {

    }
}
